# 多个装饰器能用在一个函数上吗？

def add(func):
    def inner():
        x = func()
        return x + 1

    return inner


def cube(func):
    def inner():
        x = func()
        return x * x * x

    return inner


def square(func):
    def inner():
        x = func()
        return x * x

    return inner


# test 函数有3个装饰器
@add
@cube
@square
def test():
    return 2


# 调用顺序 square -> cube -> add


print(test())
